package com.store.controller;


import com.store.configure.Result;
import com.store.entity.Notice;
import com.store.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 
 * @since 2025-01-04
 */
@RestController
@RequestMapping("/notice")
public class NoticeController {

    @Autowired
    NoticeService noticeService;

    /**
     * 添加/修改
     */
    @RequestMapping("/updateNotice")
    public Result<Notice> updateNotice(@RequestBody Notice notice) {
        return noticeService.updateNotice(notice);
    }

    /**
     * 删除
     */
    @RequestMapping("/delNotice")
    public Result<Notice> delNotice(@RequestBody Notice notice) {
        return noticeService.delNotice(notice);
    }

    /**
     * 批量删除
     */
    @RequestMapping("/batchDelNotice")
    public Result<Notice> batchDelNotice(@RequestBody Notice notice) {
        return noticeService.batchDelNotice(notice);
    }

    /**
     * 查询(不分页)
     */
    @RequestMapping("/queryNotice")
    public Result<Notice> queryNotice(@RequestBody Notice notice) {
        return noticeService.queryNotice(notice);
    }

    /**
     * 查询(分页)
     */
    @RequestMapping("/queryNoticeByPage")
    public Result<Notice> queryNoticeByPage(@RequestBody Notice notice) {
        return noticeService.queryNoticeByPage(notice);
    }

    /**
     * 根据ID查询
     */
    @RequestMapping("/queryNoticeById")
    public Result<Notice> queryNoticeById(@RequestBody Notice notice) {
        return noticeService.queryNoticeById(notice);
    }

}

